using System;

[Serializable]
public class KillAchievement : Achievement
{
	public WeaponType neededWeapon = WeaponType.Non;

	public WeaponTypeSpecific neededWeaponSpecific;

	public bool neededSniperMod;

	public bool neededHeadshot;

	public override bool CheckAchievement(KillInfo killInfo)
	{
		if (neededHeadshot && !killInfo.headshot)
		{
			return false;
		}
		if (neededSniperMod && !killInfo.sniperMod)
		{
			return false;
		}
		if (neededWeaponSpecific != 0 && killInfo.weaponTypeSpecific != neededWeaponSpecific)
		{
			return false;
		}
		if (neededWeapon != WeaponType.Non && killInfo.weaponType != neededWeapon)
		{
			return false;
		}
		return true;
	}

	public override void Init()
	{
		base.Init();
		AchievementsManager.instanse.allKillAchievements.Add(this);
	}
}
